import demo.*;
import demo.controller.UserController;
import demo.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.StudentService;
import service.UserService;

public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
/*        StudentController studentController = context.getBean("studentController",StudentController.class);
        studentController.test();*/
        /*StudentController2 studentController2 = context.getBean("studentController2", StudentController2.class);
        studentController2.test();*/
/*        StudentController3 studentController3 = context.getBean("studentController3", StudentController3.class);
        studentController3.test();
        StudentController4 studentController4 = context.getBean("studentController4", StudentController4.class);
        studentController4.test();
        StudentController5 studentController5 = context.getBean("studentController5", StudentController5.class);
        studentController5.test();*/
/*        UserService userService = context.getBean("UserService",UserService.class);
        userService.test1();
        StudentService service = context.getBean("studentService",StudentService.class);
        service.test1();
        */
/*        StudentController studentController = context.getBean("studentController",StudentController.class);
        studentController.test();*/

/*        UserController userController = context.getBean("userController",UserController.class);
        userController.test();*/
        /*bean的起名为对应的方法名，与五大类的不同*/
        /*User user = context.getBean("user1", User.class);*/
/*        User user = context.getBean("user2", User.class);*//*这种会报错，因为我们根本没办法传入参数*//*
        System.out.println(user.getAge());*/
        UserController userController = context.getBean("userController",UserController.class);
        userController.test();
    }
}
